package net.oschina.allchat.server.framework.core.internal.config;

import java.io.File;

import net.oschina.allchat.server.framework.core.config.IConfiguration;
import net.oschina.allchat.server.framework.core.config.LocalFileConfiguration;
import net.oschina.allchat.server.framework.core.internal.config.LocalDirectoryConfigurationManager.ConfigurationKey;

public class ComponentLocalFileConfiguration extends LocalFileConfiguration {
	
	public ComponentLocalFileConfiguration(ConfigurationKey configurationKey, String sFile) {
		this(configurationKey, sFile, null);
	}
	
	public ComponentLocalFileConfiguration(ConfigurationKey configurationKey, String sFile, IConfiguration parent) {
		this(configurationKey, new File(sFile), parent);
	}
	
	public ComponentLocalFileConfiguration(ConfigurationKey configurationKey, File file) {
		this(configurationKey, file, null);
	}
	
	public ComponentLocalFileConfiguration(ConfigurationKey configurationKey, File file, IConfiguration parent) {
		super(file, parent);
		
		properties.put(IConfiguration.KEY_SERVICE_ID, configurationKey.serviceId);
		if (configurationKey.dependencyPath  != null) {
			properties.put(IConfiguration.KEY_COMPONENT_DEPENDENCY_PATH, configurationKey.dependencyPath);
		}
	}

}
